import { defineStore } from 'pinia'

export const useCodeVerifierStore = defineStore('code-verifier-openiddict', {
    state: () => ({
        codeVerifier: '',
        state: '',
    }),
    actions: {
        setCodeVerifier(codeVerifier: string) {
            this.codeVerifier = codeVerifier
        },
        setState(state: string) {
            this.state = state
        },
        clearCodeVerifier() {
            this.codeVerifier = ''
            this.state = ''
        },
    },
    persist: true
})
